

#include <iostream>
#include <string>


void reverse(std::string& s)
{

	int p = 0;
	int q = s.size() - 1;
	for (; p < q;)
	{
		std::swap(s[p++], s[q--]);
	}
}


void func(char s[], int size)
{
	for (size_t i = 0; i < strlen(s); i++)
	{
		std::cout << s[i] << std::endl;
	}
}
int main(void)
{
	std::string s = "abcdefgh";

	reverse(s);
	std::cout << s << std::endl;

	/*char s[] = { 'a', 'b', 'c','\0'};
	func(s, 4);
	std::cout << strlen(s) << std::endl;*/
	return 0;
}